﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Jsons._testdriven
{
    class tc_0001
    {
        public void test()
        {
            string name = "hello";
            Console.WriteLine(Pixysoft.Json.MyJson.Instance.Serialize(name));
        }

        public void test002_reference()
        {
            Type type = typeof(DemoHandler);

            foreach (Type itype in type.GetInterfaces())
            {
                if (!itype.Name.Contains("IJsonReferense"))
                    continue;

                Type subType = itype.GetGenericArguments()[0];
                Console.WriteLine(subType);
            }
        }
    }

    class DemoHandler : IJsonHandler, IJsonReferense<SubHandler>
    {
        #region IJsonHandler 成员

        public void OnLoad(EventArgs e)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion

        #region IJsonReferense<SubHandler> 成员

        public SubHandler Referense
        {
            get { return new SubHandler(); }
        }

        #endregion
    }

    class SubHandler : IJsonHandler
    {
        #region IJsonHandler 成员

        public void OnLoad(EventArgs e)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }
}
